<?php

/**
 * This is the model class for table "rencanarealisasihutan".
 *
 * The followings are the available columns in table 'rencanarealisasihutan':
 * @property integer $rrh_id
 * @property string $rrh_bkph
 * @property string $rrh_jenis
 * @property double $rrh_rencana_luas
 * @property double $rrh_rencana_kayuperkakas
 * @property double $rrh_rencana_kayubakar
 * @property double $rrh_realisasi_luas
 * @property double $rrh_realisasi_kayuperkakas
 * @property double $rrh_realisasi_kayubakar
 * @property integer $rrh_tahun
 */
class Rencanarealisasihutan extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Rencanarealisasihutan the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'rencanarealisasihutan';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('rrh_tahun', 'numerical', 'integerOnly'=>true),
			array('rrh_rencana_luas, rrh_rencana_kayuperkakas, rrh_rencana_kayubakar, rrh_realisasi_luas, rrh_realisasi_kayuperkakas, rrh_realisasi_kayubakar', 'numerical'),
			array('rrh_bkph, rrh_jenis', 'length', 'max'=>64),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('rrh_id, rrh_bkph, rrh_jenis, rrh_rencana_luas, rrh_rencana_kayuperkakas, rrh_rencana_kayubakar, rrh_realisasi_luas, rrh_realisasi_kayuperkakas, rrh_realisasi_kayubakar, rrh_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'rrh_id' => 'Rrh',
			'rrh_bkph' => 'Rrh Bkph',
			'rrh_jenis' => 'Rrh Jenis',
			'rrh_rencana_luas' => 'Rrh Rencana Luas',
			'rrh_rencana_kayuperkakas' => 'Rrh Rencana Kayuperkakas',
			'rrh_rencana_kayubakar' => 'Rrh Rencana Kayubakar',
			'rrh_realisasi_luas' => 'Rrh Realisasi Luas',
			'rrh_realisasi_kayuperkakas' => 'Rrh Realisasi Kayuperkakas',
			'rrh_realisasi_kayubakar' => 'Rrh Realisasi Kayubakar',
			'rrh_tahun' => 'Rrh Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('rrh_id',$this->rrh_id);
		$criteria->compare('rrh_bkph',$this->rrh_bkph,true);
		$criteria->compare('rrh_jenis',$this->rrh_jenis,true);
		$criteria->compare('rrh_rencana_luas',$this->rrh_rencana_luas);
		$criteria->compare('rrh_rencana_kayuperkakas',$this->rrh_rencana_kayuperkakas);
		$criteria->compare('rrh_rencana_kayubakar',$this->rrh_rencana_kayubakar);
		$criteria->compare('rrh_realisasi_luas',$this->rrh_realisasi_luas);
		$criteria->compare('rrh_realisasi_kayuperkakas',$this->rrh_realisasi_kayuperkakas);
		$criteria->compare('rrh_realisasi_kayubakar',$this->rrh_realisasi_kayubakar);
		$criteria->compare('rrh_tahun',$this->rrh_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}